//
//  DEMineController.m
//  DE
//
//  Created by PEIYANG on 16/9/23.
//  Copyright © 2016年 YP. All rights reserved.
//

#import "DEMineController.h"
#import "GYSettingRowItem.h"
#import "GYUserItem.h"
#import "GYHeaderView.h"
#import "UIScrollView+HeaderScaleImage.h"

@interface DEMineController ()

@end

@implementation DEMineController


- (void)viewDidLoad {
    [super viewDidLoad];
    //    self.title = @"设置";
    self.navigationController.navigationBar.hidden = YES;
    
    //设置 cell 间间距
    self.tableView.sectionHeaderHeight = 2;
    self.tableView.sectionFooterHeight = 2;
    //取消顶部自动布局距离
    self.automaticallyAdjustsScrollViewInsets = NO;
    
    [self setUpGroup1];
    [self setUpGroup2];
    [self setUpGroup3];
    [self setUpGroup4];
    [self setUpGroup5];

    //设置tableView顶部视图
    GYHeaderView *headerView = [GYHeaderView headerView];
//    headerView.backgroundColor = [UIColor clearColor];
    self.tableView.tableHeaderView = headerView;
    self.tableView.contentInset = UIEdgeInsetsMake(100, 0, 0, 0);
    
    
    //设置顶部视图背景缩放效果
    self.tableView.yz_headerScaleImage = [UIImage imageNamed:@"Snip20161013_2"];

   
    
}

//描述一组
- (void)setUpGroup1 {
    GYUserItem *row1 = [[GYUserItem alloc] init];
    NSArray *array = @[row1];
    
    GYGroupItem *groupItem = [GYGroupItem itemWithRowItemArray:array];
    [self.groupArray addObject:groupItem];
}

//描述一组
- (void)setUpGroup2 {
    
    GYSettingRowItem *row1 = [GYSettingRowItem  itemWithImage:[UIImage imageNamed:@"new_setting_icon_3_paid_list_25x25_"] title:@"消息中心"];
    //要跳转到的控制器
    //    row1.desClass = [GYPushViewController class];
    
    
    //一组当中有多少行.
    NSArray *array = @[row1];
    
    GYGroupItem *groupItem =  [GYGroupItem itemWithRowItemArray:array];
    
    [self.groupArray addObject:groupItem];
    
}

//描述一组
- (void)setUpGroup3 {
    GYSettingRowItem *row1 = [GYSettingRowItem itemWithImage:[UIImage imageNamed:@"new_setting_icon_2_0_25x25_"] title:@"已下载音频" subTitle:@"1"];
    GYSettingRowItem *row2 = [GYSettingRowItem itemWithImage:[UIImage imageNamed:@"new_setting_icon_2_1_25x25_"] title:@"我赞过的" subTitle:@"0"];
    
    //一组当中有多少行.
    NSArray *array = @[row1,row2];
    GYGroupItem *groupItem =  [GYGroupItem itemWithRowItemArray:array];
    [self.groupArray addObject:groupItem];
    
}

//描述一组
- (void)setUpGroup4 {
    GYSettingRowItem *row1 = [GYSettingRowItem itemWithImage:[UIImage imageNamed:@"new_setting_icon_3_0_25x25_"] title:@"账户余额" subTitle:@"0.00"];
    GYSettingRowItem *row2 = [GYSettingRowItem itemWithImage:[UIImage imageNamed:@"new_setting_icon_3_duihuanma_25x25_"] title:@"兑换码"];
    GYSettingRowItem *row3 = [GYSettingRowItem itemWithImage:[UIImage imageNamed:@"new_setting_icon_3_paid_list_25x25_"] title:@"购买记录"];
    GYSettingRowItem *row4 = [GYSettingRowItem itemWithImage:[UIImage imageNamed:@"new_setting_icon_shopping_cart_25x25_"] title:@"购物车"];
    
    NSArray *array = @[row1,row2,row3,row4];
    GYGroupItem *groupItem = [GYGroupItem itemWithRowItemArray:array];
    [self.groupArray addObject:groupItem];
    
}

//描述一组
- (void)setUpGroup5 {
    GYSettingRowItem *row1 = [GYSettingRowItem itemWithImage:[UIImage imageNamed:@"new_setting_icon_4_0_25x25_"] title:@"帐号"];
    GYSettingRowItem *row2 = [GYSettingRowItem itemWithImage:[UIImage imageNamed:@"new_setting_icon_4_1_25x25_"] title:@"设置"];
    
    NSArray *array = @[row1,row2];
    GYGroupItem *groupItem = [GYGroupItem itemWithRowItemArray:array];
    [self.groupArray addObject:groupItem];

}


@end
